Exemple #1
0
void base_c9060_device::device_start()
{
	address_space *main = m_maincpu->memory().space(AS_PROGRAM);
	address_space *hdc = m_hdccpu->memory().space(AS_PROGRAM);

	main->install_rom(0xc000, 0xffff, subregion(M6502_TAG)->base());
	hdc->install_rom(0x1800, 0x1fff, subregion(M6504_TAG)->base());

	// state saving
	save_item(NAME(m_rfdo));
	save_item(NAME(m_daco));
	save_item(NAME(m_atna));
}
    int
    process(const tendrils& in, const tendrils& out)
    {
      cv::Size dsize = depth_in->size(), isize = image_in->size();
      cv::Mat depth;
      cv::Mat valid_mask;
      if (depth_in->type() == CV_16UC1)
      {
        depth_in->convertTo(depth, CV_32F, 1 / 1000.0); //convert to float so that we can work with NANs
        valid_mask = *depth_in == 0;
        depth.setTo(std::numeric_limits<float>::quiet_NaN(), valid_mask); //set all non valid points in the depth to NAN.
      }
      else
      {
        depth_in->convertTo(depth, CV_32F);
      }

      if (dsize == isize)
      {
        *depth_out = depth;
        return ecto::OK;
      }

      float factor = float(isize.width) / dsize.width; //scaling factor.
      cv::Mat output(isize, depth.type(), std::numeric_limits<float>::quiet_NaN()); //output is same size as image.
      //resize into the subregion of the correct aspect ratio
      cv::Mat subregion(output.rowRange(0, dsize.height * factor));
      //use nearest neighbor to prevent discontinuities causing bogus depth.
      cv::resize(depth, subregion, subregion.size(), CV_INTER_NN);
      *depth_out = output;
      return ecto::OK;
    }
void luxor_55_10828_device::device_start()
{
    // find floppy image devices
    m_image0 = machine().device(FLOPPY_0);
    m_image1 = machine().device(FLOPPY_1);

    // state saving
    save_item(NAME(m_cs));
    save_item(NAME(m_status));
    save_item(NAME(m_data));
    save_item(NAME(m_fdc_irq));
    save_item(NAME(m_fdc_drq));
    save_item(NAME(m_wait_enable));
    save_item(NAME(m_sel0));
    save_item(NAME(m_sel1));

    // patch out protection checks
    UINT8 *rom = subregion("abc830")->base();
    rom[0x00fa] = 0xff;
    rom[0x0336] = 0xff;
    rom[0x0718] = 0xff;
    rom[0x072c] = 0xff;
    rom[0x0771] = 0xff;
    rom[0x0788] = 0xff;
}
bool HoGFeature::Extract(const IntegralImage *intImage, const Rect &roi, Feature *feature, float scale) const {
	// Remeber to resize the feature vector.
	feature->Resize(36);

	int scaledWidth = (int)(m_width * scale);
	int scaledHeight = (int)(m_height * scale);

	Rect subregion(
		roi.upper + (int)(m_offsetH * scale), 
		roi.left + (int)(m_offsetW * scale), 
		scaledWidth / 2,
		scaledHeight / 2);

	/** 
	 * The patch is like this:
	 *
	 * <------[scaledWith / 2]------^-------[scaledWidth - scaledWidth / 2]------>
	 * |							|											 |
	 * [scaledHeight / 2]			|											 |
	 * |							|											 |
	 * ^----------------------------^--------------------------------------------^
	 * |							|											 |
	 * [scaledHeight -				|											 |
	 *  scaledHeight / 2]			|											 |
	 * |							|											 |
	 * ^----------------------------^--------------------------------------------^
	 */


	// Upper left.
	intImage->GetSum(subregion, feature->data);

	// Upper right.
	subregion.left += subregion.width;
	subregion.width = scaledWidth - subregion.width;
	intImage->GetSum(subregion, feature->data + 9);

	// Down right.
	subregion.upper += subregion.height;
	subregion.height = scaledHeight - subregion.height;
	intImage->GetSum(subregion, feature->data + 27);

	// Down left.
	subregion.width = scaledWidth / 2;
	subregion.left -= subregion.width;
	intImage->GetSum(subregion, feature->data + 18);

	return true;
}
    int
    process(const tendrils& in, const tendrils& out)
    {
      cv::Size dsize = depth_in->size(), isize = image_in->size();
      cv::Mat depth;
      cv::Mat valid_mask;
      rescaleDepth(*depth_in, CV_32F, depth);

      if (dsize == isize)
      {
        *depth_out = depth;
        return ecto::OK;
      }

      float factor = float(isize.width) / dsize.width; //scaling factor.
      cv::Mat output(isize, depth.type(), std::numeric_limits<float>::quiet_NaN()); //output is same size as image.
      //resize into the subregion of the correct aspect ratio
      cv::Mat subregion(output.rowRange(0, dsize.height * factor));
      //use nearest neighbor to prevent discontinuities causing bogus depth.
      cv::resize(depth, subregion, subregion.size(), CV_INTER_NN);
      *depth_out = output;
      return ecto::OK;
    }
UINT8* coco_fdc_device::get_cart_base()
{
	return subregion("eprom")->base();
}
Exemple #7
0
void comx_thm_device::device_start()
{
	m_slot = dynamic_cast<comx_expansion_slot_device *>(owner());

	m_rom = subregion("c000")->base();
}
Exemple #8
0
void kc_8k_device::device_start()
{
	m_slot = dynamic_cast<kcexp_slot_device *>(owner());
	m_rom = subregion(REGION_TAG)->base();
}